<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="laypage/laypage.js"></script>
</head>
<body>
 		<div><a href="">注册</a><a href="">登录</a></div>
 		<div>
 			
 		</div>
 		<input type="button" id="one" value="111" onclick="f1()">
 		<div >
 			<table id="two">
 				<tr><td></td></tr>
 			</table>
 		</div>
 	 	<div id="fenye"></div>
 		<script type="text/javascript">
 				var search =function(currentPage){
 				var urls="index/house_getCurrentPageHouse.do";
 			 				$.ajax({
 			 					url:urls,
 			 					type:"post",
 			 					data:{"currentPage":currentPage},
 			 					dataTpye:"json",
 			 					success:function(result){
 			 						$("#two").html("");
 			 						$.each(result.list,function(index,item){
 			 							console.log(item);
 			 							$("#two").append("<tr><td><img src='http://localhost:8081/zufangwang/upload/"+item.h_pic+"'</td><td>"+item.h_title+"</td></tr>")
 			 						});
 			 						//laypage放在success函数内
 			 						 laypage({
 			 								cont : 'fenye',  //容器id：存放分页
 			 								pages : result.totalPage, //得到总页数
 			 								curr:  result.currentPage || 1,  //当前页
 			 								skip: true, //是否开启跳页
 			 								skin: '#AF0000',  //页码的颜色
 			 								groups: 10,  //分组
 			 								jump : function(obj, first) {
 			 									if (!first) {   //首次加载不执行，并传递当前页：obj.curr
 			 										search(obj.curr);  //调用函数
 			 									}
 			 								}
 			 							}); 
 			 					}
 			 				})
 			}
 			search(1);
 		</script>
 	</body>
</html>